Revert 292399 "deps2git: Improve support for WebRTC and its deps." Breaks WebRTC's Chromium bots in http://build.chromium.org/p/chromium.webrtc/waterfall among other waterfalls. This happens due to dependencies in http://chromegw.corp.google.com/viewvc/chrome/trunk/deps/third_party/webrtc/webrtc.DEPS/ ending up with invalid Git mirrors. > deps2git: Improve support for WebRTC and its deps. > > * Remove old unused WebRTC URLs (stable branch was removed > about a year ago). > * Make the WebRTC matching more generic, so it can match both > trunk and deps. This will add support for: > - deps/third_party/junit > - deps/third_party/openmax > - deps/third_party/winsdk_samples_v71 > and thus the special case for openmax can be removed. > > BUG=419516 > TESTED=Passing build with: > scripts/tools/run_recipe.py webrtc/standalone buildername="Linux64 Debug" mastername=client.webrtc slavename=x revision='"7414"' use_mirror=True > when combined with https://codereview.chromium.org/472963003/ > > Review URL: https://codereview.chromium.org/627493002 TBR=kjellander@chromium.org Review URL: https://codereview.chromium.org/651833002 git-svn-id: http://src.chromium.org/svn/trunk/tools/deps2git@292420 4ff67af0-8c30-449e-8e8b-ad334ec8d88c 
diff --git a/svn_to_git_public.py b/svn_to_git_public.py index 58d02ac..c3a0b3a 100755 --- a/svn_to_git_public.py +++ b/svn_to_git_public.py 
@@ -61,11 +61,33 @@  if svn_url == '/trunk/deps/cdm':  return (path, GIT_HOST + 'chromium/cdm.git', GIT_HOST)   - match = re.match('^https?://webrtc.googlecode.com/svn/(deps|trunk)/(.*)', - svn_url) + # TODO(niklase) Remove after landing https://codereview.chromium.org/86563002 + if re.match('^https?://webrtc.googlecode.com/svn/stable/webrtc$', svn_url): + return (path, GIT_HOST + 'external/webrtc/stable/webrtc.git', GIT_HOST) + + # TODO(niklase) Remove after landing https://codereview.chromium.org/86563002 + if re.match('^https?://webrtc.googlecode.com/svn/stable/talk$', svn_url): + return (path, GIT_HOST + 'external/webrtc/stable/talk.git', GIT_HOST) + + # TODO(niklase) Remove after landing https://codereview.chromium.org/86563002 + if re.match('^https?://webrtc.googlecode.com/svn/stable/src$', svn_url): + return (path, GIT_HOST + 'external/webrtc/stable/src.git', GIT_HOST) + + # webrtc 'trunk/src' mirror was created without 'trunk' in the name, unlike + # the other ones which are matched next. + match = re.match('^https?://webrtc.googlecode.com/svn/trunk/src', svn_url)  if match: - repo = '%s.git' % match.group(2) - return (path, GIT_HOST + 'external/webrtc/%s/%s' % (match.group(1), repo), + return (path, GIT_HOST + 'external/webrtc/src.git', GIT_HOST) + + # webrtc 'trunk' mappings for everything but 'trunk/src'. + match = re.match('^https?://webrtc.googlecode.com/svn/trunk/(.*)', svn_url) + if match: + repo = '%s.git' % match.group(1) + return (path, GIT_HOST + 'external/webrtc/trunk/%s' % repo, GIT_HOST) + + if re.match('^https?://webrtc.googlecode.com/svn/deps/third_party/openmax$', + svn_url): + return (path, GIT_HOST + 'external/webrtc/deps/third_party/openmax.git',  GIT_HOST)    if svn_url in ('http://selenium.googlecode.com/svn/trunk/py/test', 
diff --git a/svn_to_git_public_unittest.py b/svn_to_git_public_unittest.py deleted file mode 100755 index 338ab67..0000000 --- a/svn_to_git_public_unittest.py +++ /dev/null 
@@ -1,27 +0,0 @@ -#!/usr/bin/env python -# Copyright 2014 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import unittest - -import svn_to_git_public - - -class SvnUrlToGitUrlTest(unittest.TestCase): - def testWebRtcUrls(self): - expected = { - 'deps/third_party/foo': 'external/webrtc/deps/third_party/foo', - 'trunk': 'external/webrtc', - 'trunk/bar': 'external/webrtc/trunk/bar', - } - svn_base_url = 'https://webrtc.googlecode.com/svn' - - path = 'just/some/path' - for k, v in expected.iteritems(): - res = svn_to_git_public.SvnUrlToGitUrl(path, '%s/%s' % (svn_base_url, k)) - self.assertEqual(res[0], path) - self.assertEqual(res[1], '%s%s.git' % (svn_to_git_public.GIT_HOST, v)) - -if __name__ == '__main__': - unittest.main()